﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Cadastro
{
    public partial class CadastroMateria : Form
    {
        public CadastroMateria()
        {
            InitializeComponent();
        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void button3_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            PrincipalClass Prin = new PrincipalClass();
            Prin.ExecSql("INSERT INTO MATERIA (IDMATERIA, IDPROFESSOR, TURMA, DISCIPLINA, OBS) VALUES("+
                        Convert.ToString(dsCad.Tables[0].Rows[0][0])+" , "+Convert.ToString(comboBox1.SelectedIndex)+
                        " , '" + Convert.ToString(dsCad.Tables[0].Rows[0][2])+
                        "' , '" + Convert.ToString(dsCad.Tables[0].Rows[0][3])+
                        "' , '" + Convert.ToString(dsCad.Tables[0].Rows[0][4])+"' );");
            Close();
    
        }
    }
}
